package calao.client;


import com.google.gwt.user.client.rpc.RemoteService;

public interface SessionService 
extends RemoteService 
{

	static Permission ADMIN = new Permission("calao.Admin");
				
	/** Gets session details.
	 */
	SessionInfo getSessionInfo()
	throws NotConnectedException;
	
	/** Disconnects from the workspace.
	 */
	void disconnect()
	throws NotConnectedException;
		
	/** Sets user preferences.
	 */
	void setUserPreferences(Preferences preferences)
	throws NotConnectedException;
				
	/** Sets workspace preferences.
	 * Requires permission {@link #ADMIN}.
	 */
	void setWorkspacePreferences(Preferences preferences)
	throws NotConnectedException, MissingPermissionException;
	
	/** Gets workspace preferences.
	 */
	Preferences getWorkspacePreferences()
	throws NotConnectedException;
	
	/** Gets workspace events.
	 */
	EventLog[] getPreviousEvents(long eventId, int count)
	throws NotConnectedException, MissingPermissionException;
	
	/** Lists known countries.
	 */
	Country[] listCountries()
	throws NotConnectedException;
	
}
